"""
2.给定三维空间坐标(1,2,3)和(-4,8,9)，编写一段脚本，求出两个坐标之间的距离
"""

import math

class pair_points:
    def __init__(self,p1 = [0,0,0],p2 = [0,0,0]):
        #初始化两点坐标
        self.p1 = p1
        self.p2 = p2
    
    #获取两点坐标
    def get_distance(self):
        distance = math.sqrt((self.p1[0]-self.p2[0])**2+(self.p1[1]-self.p2[1])**2+(self.p1[2]-self.p2[2])**2)
        return distance
    
points= pair_points([1,2,3],[-4,8,9])
print(f"空间两点直线距离为:{points.get_distance()}")


